<template>
  <div class="app-container">
    <el-row :gutter="20">
      <!--部门数据-->
      <el-col :span="4" :xs="24" style="padding: 10px; border: 1px solid #e3e7ef">
        <div class="head-container">
          <el-input v-model="deptName" placeholder="请输入部门名称" clearable size="small" prefix-icon="el-icon-search"
            style="margin-bottom: 20px" />
        </div>
        <div class="head-container">
          <el-tree :data="deptOptions" :props="defaultProps" :expand-on-click-node="false"
            :filter-node-method="filterNode" ref="tree" node-key="id" default-expand-all highlight-current
            @node-click="handleNodeClick" />
        </div>
      </el-col>
      <!--用户数据-->
      <el-col :span="20" :xs="24">
        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
          <el-form-item label="姓名" prop="nickName">
            <el-input v-model="queryParams.nickName" placeholder="请输入用户名称" clearable style="width: 240px"
              @keyup.enter.native="handleQuery" />
          </el-form-item>

          <el-form-item label="类型" prop="status">
            <el-select v-model="queryParams.status" placeholder="类型" clearable style="width: 240px">
              <el-option v-for="dict in dict.type.sys_docbase_user_type" :key="dict.value" :label="dict.label"
                :value="dict.value" />
            </el-select>
          </el-form-item>
          <el-form-item label="入职时间">
            <el-date-picker v-model="JoinDate" style="width: 240px" value-format="yyyy-MM-dd" type="daterange"
              range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
          </el-form-item>
          <el-form-item label="生日">
            <el-date-picker v-model="dateRange" style="width: 240px" value-format="yyyy-MM-dd" type="daterange"
              range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
          </el-form-item>
          <!-- <el-form-item label="岗位" prop="phonenumber">
            <el-select
              v-model="queryParams.postIds"
              placeholder="请选择岗位"
              clearable
              :style="{ width: '100%' }"
            >
              <el-option
                v-for="(item, index) in postOptions"
                :key="item.postId"
                :label="item.postName"
                :value="item.postId"
              ></el-option>
            </el-select>
          </el-form-item> -->
          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
          </el-form-item>
        </el-form>

        <el-row :gutter="10" class="mb8" v-if="isShowAdd">
          <!-- <el-col :span="1.5">
            <el-button
              type="primary"
              plain
              icon="el-icon-plus"
              size="mini"
              @click="handleAdd"
              v-hasPermi="['personnel:file:indexUser:add']"
              >新增</el-button
            >
          </el-col> -->
          <el-col :span="1.5">
            <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
              v-hasPermi="['personnel:file:indexUser:edit']">修改</el-button>
          </el-col>
          <!-- <el-col :span="1.5">
            <el-button
              type="danger"
              plain
              icon="el-icon-delete"
              size="mini"
              :disabled="multiple"
              @click="handleDelete"
              v-hasPermi="['personnel:file:indexUser:remove']"
              >删除</el-button
            >
          </el-col> -->
          <el-col :span="1.5">
            <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
              v-hasPermi="['personnel:file:indexUser:export']">导出</el-button>
          </el-col>
          <!-- <el-col :span="1.5">
            <el-button type="primary" plain icon="el-icon-plus" size="mini" :disabled="single" @click="handleDocCert"
              v-hasPermi="['personnel:file:indexUser:file']">维护档案资料</el-button>
          </el-col> -->
          <el-col :span="1.5">
            <el-button type="primary" plain icon="el-icon-plus" size="mini" :disabled="single" @click="handleAddCertType"
              v-hasPermi="['personnel:file:indexUser:zs']">维护项目资格证书</el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button type="warning" plain icon="el-icon-download" size="mini" @click="printBox" :disabled="multiple"
              v-hasPermi="['personnel:file:print']">打印人员一览表</el-button>
          </el-col>

          <el-col :span="1.5">
            <el-button type="warning" plain icon="el-icon-download" size="mini" @click="printBoxs"
              v-hasPermi="['personnel:file:prints']">打印人员档案目录</el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button type="warning" plain icon="el-icon-download" size="mini" @click="printBoxRecored"
              v-hasPermi="['personnel:file:record:prints']">打印人员履历</el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button type="warning" plain icon="el-icon-download" size="mini" :disabled="multiple"
              @click="printEducation" v-hasPermi="['personnel:file:record:prints']">打印个人继续教育汇总</el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button type="warning" plain icon="el-icon-download" size="mini" @click="printBoxCertificate"
              :disabled="multiple" v-hasPermi="['personnel:file:record:prints']">打印获奖证书汇总</el-button>
          </el-col>
          <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
        </el-row>

        <el-table v-loading="loading" border :data="userList" @selection-change="handleSelectionChange">
          <el-table-column type="selection" width="50" align="center" />
          <el-table-column type="index" label="序号" width="50" align="center" />

          <el-table-column label="工号" align="center">
            <template slot-scope="scope">
              {{ scope.row.userName ? scope.row.userName : "--" }}
              <i v-if="scope.row.userName" v-hasPermi="['personnel:file:edit:code']" class="el-icon-edit"
                @click="handleEditCode(scope.row)"></i>
            </template>
          </el-table-column>
          <el-table-column label="档案编号" width="150" align="center" prop="docNo" />
          <el-table-column label="真实姓名" align="center" prop="nickName" />
          <el-table-column label="登录账号" width="150" align="center">
            <template slot-scope="scope">
              {{ scope.row.phone ? scope.row.phone : "--" }}
            </template>
          </el-table-column>
          <el-table-column label="性别" align="center" prop="sex">
            <template slot-scope="scope">
              <dict-tag :options="dict.type.sys_user_sex" :value="scope.row.sex" />
            </template>
          </el-table-column>

          <el-table-column label="出生日期" width="150" align="center" prop="birthDate" />
          <el-table-column label="部门" align="center" prop="join.deptName" :show-overflow-tooltip="true" />
          <el-table-column label="所在岗位" align="center" prop="join.roleName" show-overflow-tooltip />
          <el-table-column label="入职时间" width="150" align="center" prop="join.startDate" />
          <el-table-column width="100" label="是否有账号" align="center">
            <template slot-scope="scope">
              <el-link v-if="scope.row.hasAccount == 1" type="success" :underline="false">是</el-link>
              <el-link v-else-if="scope.row.hasAccount == 0" type="danger" :underline="false">否</el-link>
              <span v-else>--</span>
            </template>
          </el-table-column>
          <el-table-column width="100" label="是否确认信息" align="center">
            <template slot-scope="scope">
              <el-link v-if="scope.row.isSure == 1" type="success" :underline="false">是</el-link>
              <el-link v-else-if="scope.row.isSure == 0" type="danger" :underline="false">否</el-link>
              <span v-else>--</span>
            </template>
          </el-table-column>
          <el-table-column label="人员分类" align="center">
            <template slot-scope="scope">
              <dict-tag :options="dict.type.sys_docbase_user_type" :value="scope.row.join.userTypeValue" />
            </template>
          </el-table-column>

          <el-table-column label="操作" align="center" width="160" fixed="right" class-name="small-padding fixed-width">
            <template slot-scope="scope">
              <el-button size="mini" type="text" icon="el-icon-view" v-hasPermi="['personnel:file:indexUser:info']"
                @click="handleDetail(scope.row)">详情</el-button>

              <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
                v-hasPermi="['personnel:file:indexUser:edit']">修改</el-button>
              <el-button v-if="scope.row.isSure != 1 && scope.row.hasAccount == 0" size="mini" type="text"
                icon="el-icon-delete" @click="handleDelete(scope.row)"
                v-hasPermi="['personnel:file:indexUser:remove']">删除</el-button>
            </template>
          </el-table-column>
        </el-table>

        <!-- 打印模板位置 -->
        <PrintBox class="scaleFont" style="width: 840mm" :printRow="printList" :isVertical="false" :page3="true"
          :checkNum="50" id="printBox" :paddrg="150">
          <template slot="title" slot-scope="scope">
            试验室人员一览表 STET/A-2
          </template>
          <template slot-scope="scope">
            <!-- 表格  class  table-page  必须-->
            <table style="width: 800mm" border="1" cellspacing="0" class="table-page">
              <!-- <thead> -->
              <tr class="table_header">
                <th style="width: 105mm">工号</th>
                <th style="width: 100mm">序号</th>
                <th style="width: 100mm">姓名</th>
                <th style="width: 100mm">性别</th>
                <th style="width: 200mm">出生年月</th>
                <th style="width: 100mm">学历</th>
                <th style="width: 150mm">毕业时间</th>
                <th style="width: 200mm">毕业学校</th>
                <th style="width: 150mm">专业</th>
                <th style="width: 150mm">职称</th>
                <th style="width: 200mm">取得职称时间</th>
                <th style="width: 200mm">聘用时间</th>
                <th style="width: 150mm">职务</th>
                <th style="width: 200mm">身份证号</th>
                <th style="width: 100mm">参加工作时间</th>
                <th style="width: 250mm">从事检查工作时间</th>
                <th style="width: 150mm">公路试验证</th>
                <th style="width: 150mm">水运试验证</th>
                <th style="width: 150mm">建设桩基试验证</th>
                <th style="width: 150mm">试验证书号</th>
              </tr>
              <!-- </thead> -->

              <!-- 同列表接口数据 -->
              <!-- <tbody > -->
              <tr v-for="(e, i) in 50">
                <td>
                  {{
                    scope.item.contentList[i] &&
                    scope.item.contentList[i].userName
                  }}
                </td>
                <td>
                  {{
                    scope.item.contentList[i] && scope.item.contentList[i]
                    ? i + 1
                    : ""
                  }}
                </td>
                <td>
                  {{
                    scope.item.contentList[i] &&
                    scope.item.contentList[i].nickName
                  }}
                </td>
                <td>
                  {{
                    scope.item.contentList[i] &&
                    scope.item.contentList[i].sex == "0"
                    ? "男"
                    : scope.item.contentList[i] &&
                      scope.item.contentList[i].sex == "1"
                      ? "女"
                      : ""
                  }}
                </td>
                <td>
                  {{
                    scope.item.contentList[i] &&
                    scope.item.contentList[i].birthDate
                  }}
                </td>
                <td>
                  <div v-for="i in scope.item.contentList[i] &&
                    scope.item.contentList[i].education
                    ? scope.item.contentList[i].education
                    : []">
                    {{ i.recordName || "" }}
                  </div>
                </td>
                <td>
                  <div v-for="i in scope.item.contentList[i] &&
                    scope.item.contentList[i].education
                    ? scope.item.contentList[i].education
                    : []">
                    {{ i.endDate || "" }}
                  </div>
                </td>
                <td>
                  <div v-for="i in scope.item.contentList[i] &&
                    scope.item.contentList[i].education
                    ? scope.item.contentList[i].education
                    : []">
                    {{ i.schoolName || "" }}
                  </div>
                </td>
                <td>
                  <div v-for="i in scope.item.contentList[i] &&
                    scope.item.contentList[i].education
                    ? scope.item.contentList[i].education
                    : []">
                    {{ i.speciality || "" }}
                  </div>
                </td>
                <td>
                  <div v-for="i in scope.item.contentList[i] &&
                    scope.item.contentList[i].userDocProfessional
                    ? scope.item.contentList[i].userDocProfessional
                    : []">
                    {{ i.professionalLabel || "" }}
                  </div>
                </td>
                <td>
                  <div v-for="i in scope.item.contentList[i] &&
                    scope.item.contentList[i].userDocProfessional
                    ? scope.item.contentList[i].userDocProfessional
                    : []">
                    {{ i.getDate || "" }}
                  </div>
                </td>
                <td>
                  {{
                    (scope.item.contentList[i] &&
                      scope.item.contentList[i].join.startDate) ||
                    ""
                  }}
                </td>
                <td>
                  {{
                    (scope.item.contentList[i] &&
                      scope.item.contentList[i].join.roleName) ||
                    ""
                  }}
                </td>

                <!-- <td>
                    {{
                      scope.item.contentList[i] &&
                      postOptions.filter((item) => {
                        return (
                          item.postId == scope.item.contentList[i].join.postIds
                        );
                      }).postName
                    }}
                  </td> -->
                <td>
                  {{
                    scope.item.contentList[i] && scope.item.contentList[i].idNum
                  }}
                </td>
                <td>
                  {{
                    scope.item.contentList[i] &&
                    scope.item.contentList[i].join.startDate
                  }}
                </td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
              </tr>
              <!-- </tbody> -->
              <!-- <div style="page-break-after: always;"></div> -->
            </table>
          </template>
        </PrintBox>
        <!-- 继续教育打印模板位置 -->
        <PrintBox :printRow="printList" checkLabel="checkLabel" :isVertical="false" :isPageSize="false"
          id="printEducation">
          <template slot="title" slot-scope="scope">
            <div style="margin-bottom: 40px;width: 100%;text-align: center;margin-left: 180px;">
              个人继续教育汇总表
            </div>

          </template>
          <template slot-scope="scope">
            <!-- 表格  class  table-page  必须-->
            <table style="border-collapse: collapse; table-layout: fixed; width: 100%" border="1" cellspacing="0"
              class="table-page" :isVertical="false">
              <tr class="table_header">
                <td rowspan="2" colspan="1" style="width: 20mm;padding: 0; ">序号</td>
                <td rowspan="2" style="width: 40mm">培训时间</td>
                <td rowspan="2" style="width: 70mm">主办单位</td>
                <td rowspan="2" style="width: 40mm">培训内容</td>

                <td rowspan="1" colspan="2" style="width: 120mm">
                  培训成果
                </td>
                <td rowspan="2" style="width: 90mm">备注</td>

              </tr>
              <tr>
                <td>证书编号</td>
                <td>其他</td>
              </tr>
              <!-- </thead> -->

              <!-- 同列表接口数据 -->
              <!-- <tbody > -->
              <tr v-for="(e, i) in scope.item.contentList[0].educationVos">
                <td>
                  {{
                    i + 1
                  }}
                </td>
                <td>
                  {{
                    e.educationTime
                  }}
                </td>
                <td>
                  {{
                    e.organization
                  }}
                </td>
                <td>
                  {{
                    e.content
                  }}
                </td>
                <!-- <tr> -->
                <!-- 培训成果 -->
                <td style="width: 20mm;">
                  {{
                    e.certCode || '/'
                  }}
                </td>

                <td>
                  {{
                    e.otherInfo || '/'
                  }}
                </td>
                <!-- </tr> -->
                <td>
                  {{
                    e.remark
                  }}
                </td>
                <!-- <td></td>
                <td></td>
                <td></td>
                <td></td> -->
              </tr>
              <!-- </tbody> -->
              <!-- <div style="page-break-after: always;"></div> -->
            </table>
          </template>
        </PrintBox>
        <!-- 个人获奖证书打印模板位置 -->
        <PrintBox :printRow="printList" checkLabel="checkLabel" :isVertical="false" :isPageSize="false"
          id="printBoxCertificate">
          <template slot="title" slot-scope="scope">
            <div style="margin-bottom: 40px;;width: 500mm;text-align: center;">
              个人获奖证书汇总表
            </div>

          </template>
          <template slot-scope="scope">
            <!-- 表格  class  table-page  必须-->
            <table style="border-collapse: collapse; table-layout: fixed; width: 100%" border="1" cellspacing="0"
              class="table-page" :isVertical="false">
              <!-- <thead> -->
              <tr class="table_header">
                <th style="width: 50mm">序号</th>
                <th style="width: 80mm">获奖时间</th>
                <th style="width: 100mm">组织方</th>
                <th style="width: 100mm">奖项等级</th>
                <th style="width: 100mm">
                  奖项类别
                </th>
                <th style="width: 100mm">奖项介绍</th>
              </tr>
              <!-- </thead> -->

              <!-- 同列表接口数据 -->
              <!-- <tbody > -->
              <tr v-for="v in 10">
              <tr v-for="(e, i) in scope.item.contentList[0].rewards">
                <td>
                  {{
                    scope.item.contentList[i] && scope.item.contentList[i]
                    ? i + 1
                    : ""
                  }}
                </td>
                <td>
                  {{
                    e.rewardTime
                  }}
                </td>
                <td>
                  {{
                    e.organization
                  }}
                </td>
                <td>
                  {{
                    e.rewardLevel
                  }}
                </td>
                <td>
                  {{
                    e.rewardType
                  }}
                </td>
                <td>
                  {{
                    e.rewardContent
                  }}
                </td>

                <!-- <td></td>
                <td></td>
                <td></td>
                <td></td> -->
              </tr>
              </tr>

              <!-- </tbody> -->
              <!-- <div style="page-break-after: always;"></div> -->
            </table>
          </template>
        </PrintBox>
        <!-- 打印模板位置 -->
        <PrintBox :printRow="printLists" id="printBoxs">
          <template slot="title" slot-scope="scope">
            人员档案目录STET/B/14-7
          </template>
          <template slot-scope="scope">
            <!-- 表格  class  table-page  必须-->
            <table style="border-collapse: collapse" border="1" cellspacing="0" class="table-page wasd"
              :isVertical="false">
              <tr>
                <td style="width: 20mm; padding: 1mm">序号</td>
                <td colspan="10" style="width: 160mm; padding: 1mm">内容</td>
                <td style="width: 20mm; padding: 1mm">份数</td>
                <td style="width: 20mm; padding: 1mm">备注</td>
              </tr>
              <tr>
                <td style="width: 20mm; padding: 1mm">一</td>
                <td colspan="10" style="width: 160mm; padding: 1mm; text-align: left">
                  个人履历表
                </td>
                <td style="width: 20mm; padding: 1mm">1</td>
                <td style="width: 20mm; padding: 1mm"></td>
              </tr>
              <tr>
                <td style="width: 20mm; padding: 1mm">二</td>
                <td colspan="10" style="width: 160mm; text-align: left; padding: 1mm">
                  相关证书复印件
                </td>
                <td style="width: 20mm; padding: 1mm">{{ scope.item.totalCertificate }}</td>
                <td style="width: 20mm; padding: 1mm"></td>
              </tr>
              <tr>
                <td style="width: 20mm; padding: 1mm">1</td>
                <td colspan="10" style="width: 160mm; text-align: left; padding: 1mm">
                  身份证
                </td>
                <td style="width: 20mm; padding: 1mm">
                  1
                </td>
                <td style="width: 20mm; padding: 1mm"></td>
              </tr>
              <tr>
                <td style="width: 20mm; padding: 1mm">2</td>
                <td colspan="10" style="width: 160mm; text-align: left; padding: 1mm">
                  毕业证书
                </td>
                <td style="width: 20mm; padding: 1mm">
                  {{ scope.item.education.length }}
                </td>
                <td style="width: 20mm; padding: 1mm"></td>
              </tr>
              <tr>
                <td style="width: 20mm; padding: 1mm">3</td>
                <td colspan="10" style="width: 160mm; text-align: left; padding: 1mm">
                  学位证书
                </td>
                <td style="width: 20mm; padding: 1mm">
                  {{ scope.item.education.length }}
                </td>
                <td style="width: 20mm; padding: 1mm"></td>
              </tr>
              <tr>
                <td style="width: 20mm; padding: 1mm">4</td>
                <td colspan="10" style="width: 160mm; text-align: left; padding: 1mm">
                  职称证书
                </td>
                <td style="width: 20mm; padding: 1mm">
                  {{ scope.item.userDocProfessional.length }}
                </td>
                <td style="width: 20mm; padding: 1mm"></td>
              </tr>
              <tr>
                <td rowspan="7" style="width: 20mm; padding: 1mm">5</td>
                <td colspan="3" rowspan="7" style="width: 30mm">
                  继续教育情况(岗位证书)
                </td>
                <td colspan="7" style="width: 130mm; text-align: left; padding: 1mm">
                  继续教育汇总表
                </td>
                <td style="width: 20mm; padding: 1mm">1</td>
                <td rowspan="7" style="width: 20mm; padding: 1mm">详见附表</td>
              </tr>
              <tr>
                <td colspan="2" rowspan="2" style="width: 30mm">建设工程</td>
                <td colspan="5" rowspan="1" style="width: 130mm; text-align: left; padding: 1mm">
                  <div style="display: flex">
                    材料类检师<input type="checkbox"
                      :checked="scope.item.materialInspectorQuantity && scope.item.materialInspectorQuantity > 0" />
                    <span style="margin-left: 20mm">材料类检员</span>
                    <input type="checkbox"
                      :checked="scope.item.materialWorkerQuantity && scope.item.materialWorkerQuantity > 0" />
                  </div>
                </td>
                <td style="width: 20mm; padding: 1mm">
                  <!-- {{ checkCert(scope.item.cert, 5) }} -->
                  {{ (scope.item.materialInspectorQuantity || 0) + (scope.item.materialWorkerQuantity || 0) }}
                </td>
              </tr>
              <tr>
                <td colspan="5" rowspan="1" style="width: 130mm; text-align: left; padding: 1mm">
                  <div style="display: flex">
                    地基类检师<input type="checkbox"
                      :checked="scope.item.structInspectorQuantity && scope.item.structInspectorQuantity > 0" />
                    <span style="margin-left: 20mm">地基类检员</span>
                    <input type="checkbox"
                      :checked="scope.item.structWorkerQuantity && scope.item.structWorkerQuantity > 0" />
                  </div>
                </td>
                <td style="width: 20mm; padding: 1mm">
                  <!-- {{
                    checkNum(
                      checkCert(scope.item.cert, 6),
                      checkCert(scope.item.cert, 7)
                    )
                  }} -->
                  {{ (scope.item.structInspectorQuantity || 0) + (scope.item.structWorkerQuantity || 0) }}
                </td>
              </tr>
              <tr>
                <td colspan="2" rowspan="1" style="width: 30mm">公路工程</td>
                <td colspan="5" rowspan="1" style="width: 130mm; text-align: left; padding: 1mm">
                  <div style="display: flex">
                    检师<input type="checkbox"
                      :checked="scope.item.roadInspectorQuantity && scope.item.roadInspectorQuantity > 0" />
                    <span style="margin-left: 20mm">检员</span>
                    <input type="checkbox"
                      :checked="scope.item.roadWorkerQuantity && scope.item.roadWorkerQuantity > 0" />
                  </div>
                </td>
                <td style="width: 20mm; padding: 1mm">
                  <!-- {{
                    checkNum(
                      checkCert(scope.item.cert, 9),
                      checkCert(scope.item.cert, 8)
                    )
                  }} -->
                  {{ (scope.item.roadInspectorQuantity || 0) + (scope.item.roadWorkerQuantity || 0) }}
                </td>
              </tr>
              <tr>
                <td colspan="2" rowspan="1" style="width: 30mm">水运工程</td>
                <td colspan="5" rowspan="1" style="width: 130mm; text-align: left; padding: 1mm">
                  <div style="display: flex">
                    检师<input type="checkbox"
                      :checked="scope.item.waterInspectorQuantity && scope.item.waterInspectorQuantity > 0" />
                    <span style="margin-left: 20mm">检员</span>
                    <input type="checkbox"
                      :checked="scope.item.waterWorkerQuantity && scope.item.waterWorkerQuantity > 0" />
                  </div>
                </td>
                <td style="width: 20mm; padding: 1mm">
                  <!-- {{
                    // checkNum(
                    //   checkCert(scope.item.cert, 11),
                    //   checkCert(scope.item.cert, 10)
                    // )
                  // }} -->
                  {{ (scope.item.waterInspectorQuantity || 0) + (scope.item.waterWorkerQuantity || 0) }}

                </td>
              </tr>
              <tr>
                <td colspan="7" style="width: 30mm; text-align: left; padding: 1mm">
                  其他证书
                </td>
                <td style="width: 20mm; padding: 1mm">
                  {{ scope.item.otherCertQuantity || 0 }}
                </td>
              </tr>
              <tr>
                <td colspan="7" style="width: 30mm; text-align: left; padding: 1mm">
                  其他继续教育证书
                </td>
                <td style="width: 20mm; padding: 1mm">
                  {{ scope.item.otherEducationQuantity || 0 }}
                </td>
              </tr>
              <tr>
                <td style="width: 20mm; padding: 1mm">6</td>
                <td colspan="10" style="width: 160mm; text-align: left; padding: 1mm">
                  荣誉证书
                </td>
                <td style="width: 20mm; padding: 1mm">
                  {{ scope.item.rewards.length }}
                </td>
                <td style="width: 20mm; padding: 1mm"></td>
              </tr>
              <tr>
                <td style="width: 20mm; padding: 1mm">三</td>
                <td colspan="10" style="width: 160mm; text-align: left; padding: 1mm">
                  试验室岗位确认
                </td>
                <td style="width: 20mm; padding: 1mm">{{ scope.item.applyWorkQuantity || 0 }}</td>
                <td style="width: 20mm; padding: 1mm"></td>
              </tr>
              <tr>
                <td style="width: 20mm; padding: 1mm">四</td>
                <td colspan="10" style="width: 160mm; text-align: left; padding: 1mm">
                  公司任命文件复印件
                </td>
                <td style="width: 20mm; padding: 1mm">{{ scope.item.appointQuantity || 0 }}</td>
                <td style="width: 20mm; padding: 1mm"></td>
              </tr>
              <tr>
                <td style="width: 20mm; padding: 1mm">五</td>
                <td colspan="10" style="width: 160mm; text-align: left; padding: 1mm">
                  授权书复印件
                </td>
                <td style="width: 20mm; padding: 1mm">{{ scope.item.authorizationQuantity || 0 }}</td>
                <td style="width: 20mm; padding: 1mm"></td>
              </tr>
              <tr>
                <td style="width: 20mm; padding: 1mm">六</td>
                <td colspan="10" style="width: 160mm; text-align: left; padding: 1mm">
                  发表论文、专利、著作复印件
                </td>
                <td style="width: 20mm; padding: 1mm">{{ scope.item.certQuantity || 0 }}</td>
                <td style="width: 20mm; padding: 1mm"></td>
              </tr>
              <tr>
                <td style="width: 20mm; padding: 1mm">七</td>
                <td colspan="10" style="width: 160mm; text-align: left; padding: 1mm">
                  个人工作总结
                </td>
                <td style="width: 20mm; padding: 1mm">0</td>
                <td style="width: 20mm; padding: 1mm"></td>
              </tr>
              <tr>
                <td style="width: 20mm; padding: 1mm">八</td>
                <td colspan="10" style="width: 160mm; text-align: left; padding: 1mm">
                  劳动合同复印件
                </td>
                <td style="width: 20mm; padding: 1mm">{{ scope.item.laborContract || 0 }}</td>
                <td style="width: 20mm; padding: 1mm"></td>
              </tr>
              <tr>
                <td style="width: 20mm; padding: 1mm">九</td>
                <td colspan="10" style="width: 160mm; text-align: left; padding: 1mm">
                  其他
                </td>
                <td style="width: 20mm; padding: 1mm">{{ scope.item.otherQuantity || 0 }}</td>
                <td style="width: 20mm; padding: 1mm"></td>
              </tr>
            </table>
            <!-- 底部信息位置 -->
            <div class="page-bottom" style="page-break-after: always">
              <div class="desc">注：本表格自2021年6月1日起生效</div>
            </div>
          </template>
        </PrintBox>
        <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
          @pagination="getList" />
      </el-col>
    </el-row>
    <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
        <el-tabs v-model="form.type" @tab-click="changeTab">
          <el-tab-pane label="公路/水运" name="1"></el-tab-pane>
          <el-tab-pane label="建设试验" name="2"></el-tab-pane>
          <el-tab-pane label="建设审核" name="3"></el-tab-pane>
        </el-tabs>
        <el-row>
          <el-col :span="24">
            <el-form-item label="资格证书" prop="certTypeId">
              <treeselect multiple v-model="form.certTypeId" :options="cretList" :normalizer="normalizer"
                placeholder="选择资格证书" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
    <!-- 打印模板位置 -->
    <PrintBox :isPageSize="false" :printRow="printList" id="printBoxsLl">
      <template slot="title" slot-scope="scope">
        试验室人员履历表 STET/B/14-2
      </template>
      <template slot-scope="scope">
        <!-- 表格  class  table-page  必须-->
        <table style="border-collapse: collapse" border="1" cellspacing="0" class="table-page wasd" :isVertical="false">
          <tr>
            <td style="width: 30mm">姓名</td>
            <td style="width: 30mm">{{ scope.item.nickName }}</td>
            <td style="width: 30mm">性别</td>
            <td style="width: 30mm">
              {{ checkDict(dict.type.sys_user_sex, scope.item.sex) }}
            </td>
            <td style="width: 30mm">出生年月</td>
            <td style="width: 30mm">{{ scope.item.birthDate }}</td>
            <td rowspan="8" style="width: 50mm">
              <img style="width: 230px; height: 250px; object-fit: cover" :src="$VUE_APP_IMG_API + scope.item.photo" />
            </td>
          </tr>
          <tr>
            <td>籍贯</td>
            <td>{{ scope.item.nativePlace }}</td>
            <td>现住地址</td>
            <td colspan="3">{{ scope.item.nowAddress }}</td>
          </tr>
          <tr>
            <td rowspan="3">毕业时间、学校、专业</td>
            <td>第一学历</td>
            <td colspan="4">
              <span v-if="scope.item.education[0]">
                {{ scope.item.education[0].startDate }}~{{
                  scope.item.education[0].endDate
                }}-{{ scope.item.education[0].schoolName }}-{{
  scope.item.education[0].speciality
}}-{{ scope.item.education[0].recordName }}
              </span>
            </td>
          </tr>
          <tr>
            <td>第二学历</td>
            <td colspan="4">
              <span v-if="scope.item.education[1]">
                {{ scope.item.education[1].startDate }}~{{
                  scope.item.education[1].endDate
                }}-{{ scope.item.education[1].schoolName }}-{{
  scope.item.education[1].speciality
}}-{{ scope.item.education[1].recordName }}
              </span>
            </td>
          </tr>
          <tr>
            <td>第三学历</td>
            <td colspan="4">
              <span v-if="scope.item.education[2]">
                {{ scope.item.education[2].startDate }}~{{
                  scope.item.education[2].endDate
                }}-{{ scope.item.education[2].schoolName }}-{{
  scope.item.education[2].speciality
}}-{{ scope.item.education[2].recordName }}
              </span>
            </td>
          </tr>
          <tr>
            <td rowspan="2">职称</td>
            <td colspan="3">职称</td>
            <td colspan="2">获取时间</td>
            <!-- <td colspan="">专业（学科）</td>
            <td colspan="">职称系列</td> -->
            <!-- <td>初级</td>
            <td colspan="4">
              {{ checkUserDocProfessional(scope.item, 0) }}
              {{ scope.item.userDocProfessional.professionalValue == 0 ?
                scope.item.userDocProfessional.professionalQualificationsLabel : ""
              }}
            </td> -->
          </tr>
          <tr v-for="(lab, val) in scope.item.userDocProfessional">
            <td colspan="3">{{ lab.professionalLabel }}</td>
            <td colspan="2"> {{ lab.getDate }}</td>
            <!-- <td> {{ lab.organization }}</td>
            <td> {{ lab.content }}</td> -->
            <!-- <td> {{ lab.remark }}</td> -->

          </tr>

          <tr>
            <td>拟从事工作内容</td>
            <td colspan="6"></td>
          </tr>
          <tr>
            <td>现聘用单位</td>
            <td colspan="2">{{ scope.item.nowCompany }}</td>
            <td>联系方式</td>
            <td>{{ scope.item.phone }}</td>
            <td>身体状况</td>
            <td>{{ scope.item.healthName }}</td>
          </tr>

          <tr>
            <td>与现聘用单位关系</td>
            <td colspan="7">
              <div>
                <div style="display: flex; align-items: center">
                  <input type="checkbox" :checked="scope.item.nowCompanyRelationship &&
                    scope.item.nowCompanyRelationship.includes(1)
                    " />公司聘用的合同制职工（是打√，不是打x，不适用打^）
                </div>
                <div style="display: flex; align-items: center">
                  <input type="checkbox" :checked="scope.item.nowCompanyRelationship &&
                    scope.item.nowCompanyRelationship.includes(2)
                    " />公司雇用的劳务派遣人员
                </div>
                <div style="display: flex; align-items: center">
                  <input type="checkbox" :checked="scope.item.nowCompanyRelationship &&
                    scope.item.nowCompanyRelationship.includes(3)
                    " />与原单位是否解除劳务合同关系
                </div>
              </div>
            </td>
          </tr>
          <tr>
            <td>个人简历</td>
            <td colspan="7" style="height: 140mm">
              <div v-for="lab in scope.item.work"
                style="display: flex;align-items: center;justify-content: space-between;">
                <div style="margin-left: 50px;">{{ lab.startDate }} ~ {{ lab.endDate }}</div>
                <div style="">{{ lab.company }}</div>
                <div style="width: 150px;">{{ lab.dept }}</div>
              </div>
            </td>
          </tr>
          <tr>
            <td colspan="8">
              <div style="
                  display: flex;
                  align-items: center;
                  justify-content: space-between;
                ">
                <div>说明：以上内容由个人自己填写，所填信息必须真实。</div>
                <div style="
                    display: flex;
                    justify-content: flex-end;
                    text-align: left;
                  ">
                  <div style="width: 30mm">签名：</div>
                  <div style="width: 15mm">年</div>
                  <div style="width: 15mm">月</div>
                  <div style="width: 15mm">日</div>
                </div>
              </div>
            </td>
          </tr>
        </table>
        <!-- 底部信息位置 -->
        <div class="desc">注：请附毕业证书、职称聘书、身份证的复印件。</div>
        <div class="page-bottom" style="page-break-after: always">
          <div class="desc">注：本表格自2021年6月1日起生效</div>
        </div>
      </template>
    </PrintBox>
    <el-dialog :visible.sync="editCodeShow" title="修改工号" width="500px" append-to-body>
      <el-form ref="formEdit" :model="formEdit" :rules="rules" label-width="120px">
        <el-form-item label="新工号" prop="userName">
          <el-input v-model="formEdit.userName" placeholder="请输入新工号" clearable :style="{ width: '100%' }">
          </el-input>
        </el-form-item>
      </el-form>
      <template slot="footer">
        <el-button size="mini" @click="editCodeShow = false">取 消</el-button>
        <el-button size="mini" type="primary" @click="saveCode">确 定</el-button>
      </template>
    </el-dialog>
  </div>
</template>

<script>
import { checkRow } from "@/utils/ruoyi.js";

import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { optionselectPost } from "@/api/system/post.js";
import { listCertType } from "@/api/system/qualification.js";
import { deptTreeSelect, updateCode } from "@/api/system/user";
import {
  delDocBase,
  listDocBase,
  batchAddUserDocCertType,
  userDocCertType,
} from "@/api/finance/personnel/file.js";
import printStyle from "@/utils/print.js";

export default {
  name: "File",
  dicts: [
    "sys_user_sex",
    "sys_docbase_political",
    "sys_docbase_marital",
    "sys_docbase_professional",
    "sys_docbase_zzdj",
    "sys_docbase_user_type",
  ],
  components: { Treeselect },

  data() {
    return {
      isShowAdd: true,
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 用户表格数据
      userList: null,
      // 弹出层标题
      title: "维护项目资格证书",
      // 部门树选项
      deptOptions: undefined,
      // 是否显示弹出层
      open: false,
      // 部门名称
      deptName: undefined,
      // 默认密码
      initPassword: undefined,
      // 日期范围
      dateRange: [],
      JoinDate: [],
      // 岗位选项
      postOptions: [],
      // 角色选项
      roleOptions: [],
      // 表单参数
      form: { type: "1", certTypeId: undefined },
      rules: {
        userName: [
          { required: true, message: "工号不能为空", trigger: "blur" },
        ],
        certTypeId: [
          { required: true, message: "资格证书不能为空", trigger: "blur" },
        ],
      },
      defaultProps: {
        children: "children",
        label: "label",
      },

      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        nickName: undefined,
        phonenumber: undefined,
        status: undefined,
        deptId: undefined,
        person: 0,
        userManager: 1
      },
      openCertType: false,
      cretList: [],
      infos: [],
      printList: [],
      printLists: [],
      editCodeShow: false,
      formEdit: {},
    };
  },
  watch: {
    // 根据名称筛选部门树
    deptName(val) {
      this.$refs.tree.filter(val);
    },
  },
  created() {
    const str = sessionStorage.getItem('queryParams');
    console.log(str);
    if (str) {
      this.queryParams = JSON.parse(str)
      if (this.queryParams.startJoinDate) {
        this.JoinDate.push(this.queryParams.startJoinDate, this.queryParams.endJoinDate)
      }
      if (this.queryParams.startBirthDate) {
        this.dateRange.push(this.queryParams.startBirthDate, this.queryParams.endBirthDate)
      }
      setTimeout(() => {
        sessionStorage.removeItem('queryParams');
      }, 500)
    }
    this.getList();
    this.optionselectPost();
    this.getDeptTree();
  },
  methods: {
    saveCode() {
      this.$refs["formEdit"].validate((valid) => {
        if (valid) {
          updateCode(this.formEdit).then((response) => {
            this.$modal.msgSuccess("操作成功");
            this.editCodeShow = false;
            this.getList();
          });
        }
      });
    },
    handleEditCode(e) {
      console.log("e", e);

      this.formEdit.userId = e.userId;
      this.editCodeShow = true;
    },
    checkUserDocProfessional(e, value) {
      let flag = e.userDocProfessional.some(
        (_e) => _e.professionalValue == value
      );
      return flag ? "√" : "";
    },
    checkNum(e, e2) {
      let num1 = e ? e : 0;
      let num2 = e2 ? e2 : 0;
      console.log(num1, num2);
      return num1 + num2;
    },
    checkCert(e, value) {
      console.log(e);
      if (e.length) {
        let info = e.find((e) => e.docTypeValue == value);
        if (info) {
          return info.url.split(",").length;
        } else {
          return "";
        }
      } else {
        return "";
      }
    },
    printBox() {
      //infos  勾选的数据 如果有勾选就打印勾选。
      console.log(this.infos);
      if (this.infos.length) {
        this.printList = [
          {
            contentList: this.infos,
          },
        ];
      } else {
        //反之打印当前整个列表
        this.printList = [
          {
            contentList: this.userList,
          },
        ];
      }
      console.log(this.printList, "---111");

      setTimeout(() => {
        this.$print({
          printable: "printBox", //打印区域id
          type: "html", //打印类型是html
          scanStyles: false,
          targetStyles: ["*"],
          style: this.workStyleylb(),
        });
      }, 500);
    },
    printBoxRecored() {
      if (this.infos.length) {
        this.printList = this.infos;
      } else {
        //反之打印当前整个列表
        this.printList = this.userList;
      }
      console.log(this.printList, "this.printList");
      setTimeout(() => {
        this.$print({
          printable: "printBoxsLl", //打印区域id
          type: "html", //打印类型是html
          scanStyles: false,
          targetStyles: ["*"],
          style: this.workStyleLl(),
        });
      }, 500);
    },
    printBoxCertificate() {
      console.log(this.infos);

      //infos  勾选的数据 如果有勾选就打印勾选。
      if (this.infos.length) {
        this.printList = [
          {
            contentList: this.infos,
          },
        ];
      } else {
        //反之打印当前整个列表
        this.printList = [
          {
            contentList: this.userList,
          },
        ];
      }
      console.log(this.printList, "---111");

      setTimeout(() => {
        this.$print({
          printable: "printBoxCertificate", //打印区域id
          type: "html", //打印类型是html
          scanStyles: false,
          targetStyles: ["*"],
          style: this.workStyleylb(),
        });
      }, 500);
    },
    // 教育打印
    printEducation() {
      console.log(this.infos);

      //infos  勾选的数据 如果有勾选就打印勾选。
      if (this.infos.length) {
        this.printList = [
          {
            contentList: this.infos,
          },
        ];
      } else {
        //反之打印当前整个列表
        this.printList = [
          {
            contentList: this.userList,
          },
        ];
      }
      console.log(this.printList, "---111");

      setTimeout(() => {
        this.$print({
          printable: "printEducation", //打印区域id
          type: "html", //打印类型是html
          scanStyles: false,
          targetStyles: ["*"],
          style: this.workStyleylb(),
        });
      }, 500);
    },
    printBoxs() {
      if (this.infos.length) {
        this.printLists = this.infos;
      } else {
        //反之打印当前整个列表
        this.printLists = this.userList;
      }
      console.log(this.infos, 'this.infos')

      setTimeout(() => {
        this.$print({
          printable: "printBoxs", //打印区域id
          type: "html", //打印类型是html
          scanStyles: false,
          targetStyles: ["*"],
          style: this.workStyle(),
        });
      }, 500);
    },
    workStyleylb() {
      return `${printStyle}
      body {zoom: 50%;}
      .scaleFont{
        transform: scale(1);
        transform-origin: top left;

      }
        table,
      table tr th,
      table tr td {
        border: 1px solid;
        height: 10mm;
        padding:0;
        font-size:12px;

      }
      tr {
        page-break-inside: avoid;
      }
      .table_header{
        font-size:12px;
      }
      `;
    },
    // 可以自定义样式  printStyle 是公共样式 切勿私自修改
    workStyle() {
      return `${printStyle}
      .desc{
        text-align: left; font-size: 12px; margin-top: 10px
      }
        table,
      table tr th,
      table tr td {
        border: 1px solid;
        height: 10mm;

      }
      tr {
        page-break-inside: avoid;
      }
      .table_header{
        font-size:14px;
      }
      `;
    },
    workStyleLl() {
      return `${printStyle}

      .desc{
        text-align: left; font-size: 12px; margin-top: 10px
      }
        table,
      table tr th,
      table tr td {
        border: 1px solid;
        height: 20px;
        padding: 5px;

      }
      tr {
        page-break-inside: avoid;
      }
      .table_header{
        font-size:16px;
      }
      `;
    },
    /** 转换资格证书数据结构 */
    normalizer(node) {
      if (node.children && !node.children.length) {
        delete node.children;
      }
      return {
        id: node.certTypeId,
        label: node.certTypeName,
        children: node.children,
      };
    },
    getCretList() {
      listCertType({ type: this.form.type }).then((response) => {
        this.cretList = this.handleTree(response.data, "certTypeId");
      });
    },
    /** 查询用户列表 */
    getList() {
      this.loading = true;
      this.queryParams = this.addDateRangeTime(
        this.queryParams,
        this.dateRange,
        "startBirthDate",
        "endBirthDate"
      );
      listDocBase(
        this.addDateRangeTime(
          this.queryParams,
          this.JoinDate,
          "startJoinDate",
          "endJoinDate"
        )
      ).then((response) => {
        this.userList = response.rows;
        this.total = response.total;
        this.loading = false;
        this.userList.forEach((item, index) => {
          // education :毕业证书 和学位证书
          item.totalCertificate = 2
            + (item.education.length || 0)
            + (item.education.length|| 0)
            + (item.userDocProfessional.length| 0)
            + (item.otherEducationQuantity || 0)
            + (item.rewards.length || 0)
            + ((item.materialInspectorQuantity || 0)
              + (item.materialWorkerQuantity || 0))
            + ((item.structInspectorQuantity || 0)
              + (item.structWorkerQuantity || 0))
            + ((item.roadInspectorQuantity || 0)
              + (item.roadWorkerQuantity || 0))
            + ((item.waterInspectorQuantity || 0)
              + (item.waterWorkerQuantity || 0))
            + (item.otherCertQuantity || 0)
          if (index == 7) {
            console.log(item.totalCertificate, item.rewards.length, item.userDocProfessional.length);
          }
        })
      
      });
    },
    /** 查询部门下拉树结构 */
    getDeptTree() {
      deptTreeSelect().then((response) => {
        this.deptOptions = response.data;
      });
    },
    // 筛选节点
    filterNode(value, data) {
      if (!value) return true;
      return data.label.indexOf(value) !== -1;
    },
    // 节点单击事件
    handleNodeClick(data) {
      this.queryParams.deptId = data.id;
      this.handleQuery();
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        certTypeId: undefined,
        certTypeName: undefined,
        type: "1",
      };

      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.dateRange = [];
      this.JoinDate = [];
      this.dateRange = [];
      this.resetForm("queryForm");
      this.queryParams.deptId = undefined;
      this.$refs.tree.setCurrentKey(null);
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map((item) => item.userDocBaseId);
      this.infos = selection;
      this.single = selection.length != 1;
      this.multiple = !selection.length;
    },

    /** 新增按钮操作 */
    handleAdd() {
      this.$router.push("/finance/personnel/fileAdd");
    },
    optionselectPost() {
      optionselectPost().then((response) => {
        this.postOptions = response.data;
      });
    },

    /** 修改按钮操作 */
    handleUpdate(row) {
      // let queryParams = JSON.stringify(this.queryParams)
      console.log(JSON.stringify(this.queryParams));
      sessionStorage.setItem('queryParams', JSON.stringify(this.queryParams));
      // sessionStorage.setItem('pageNum', this.queryParams.pageNum);
      const configId = row.userDocBaseId || this.ids;
      let e;
      if (Array.isArray(configId)) {
        e = this.userList.find((i) => configId.includes(i.userDocBaseId));
      } else {
        e = this.userList.find((i) => configId == i.userDocBaseId);
      }
      // if (e.isSure == 1) {
      //   this.$message.warning("信息确认不允许修改");
      //   return;
      // }
      this.$router.push("./fileAdd?isEdit=true&id=" + configId);
    },
    handleDetail(row) {
      // sessionStorage.setItem('pageNum', this.queryParams.pageNum);
      sessionStorage.setItem('queryParams', JSON.stringify(this.queryParams));

      this.$router.push("./fileAdd?isInfo=true&id=" + row.userDocBaseId);
    },
    handleDocCert(row) {
      const configId = row.userDocBaseId || this.ids;
      this.$router.push("/setup/user/userDocCert?id=" + configId);
    },
    handleAddCertType(row) {
      sessionStorage.setItem('queryParams', JSON.stringify(this.queryParams));
      const configId = row.userDocBaseId || this.ids;
      this.$router.push("/setup/user/userCertType?id=" + configId);

      return;
      this.reset();
      this.getCretList();
      this.form.userDocBaseId = configId.toString();
      userDocCertType({
        userDocBaseId: this.form.userDocBaseId,
        type: this.form.type,
      }).then((res) => {
        this.form.certTypeId = res.data
          .filter((e) => e.selectFlag)
          .map((i) => i.certTypeId);
        console.log(res.data);
      });
      this.open = true;
    },
    changeTab() {
      this.form.certTypeId = [];
      this.getCretList();
      userDocCertType({
        userDocBaseId: this.form.userDocBaseId,
        type: this.form.type,
      }).then((res) => {
        this.form.certTypeId = res.data
          .filter((e) => e.selectFlag)
          .map((i) => i.certTypeId);
        console.log(res.data);
      });
    },
    /** 提交按钮 */
    submitForm: function () {
      this.$refs["form"].validate((valid) => {
        if (valid) {
          batchAddUserDocCertType(this.form).then((response) => {
            this.$modal.msgSuccess("设置成功");
            this.open = false;
            this.getList();
          });
        }
      });
    },
    handleExport() {
      this.download(
        "system/docBase/export",
        {
          ...this.queryParams,
          userDocBaseIds: this.ids.toString(),
        },
        `人员记录表_${this.parseTime(new Date().getTime(), "{y}-{m}-{d}")}.xlsx`
      );
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const userIds = row.userDocBaseId || this.ids;
      console.log(userIds);
      let name = checkRow(
        userIds,
        this.userList,
        "userDocBaseId",
        "DELETE",
        "nickName"
      );
      let flag;

      if (Array.isArray(userIds)) {
        flag = this.userList
          .filter((i) => userIds.includes(i.userDocBaseId))
          .some((e) => !(e.isSure != 1 && e.hasAccount == 0));
      } else {
        flag = this.userList
          .filter((i) => userIds == i.userDocBaseId)
          .some((e) => !(e.isSure != 1 && e.hasAccount == 0));
      }
      if (flag) {
        this.$message.warning("信息确认不允许删除");
        return;
      }
      console.log(flag);
      this.$modal
        .confirm('是否确认删除姓名为"' + name + '"的数据项？')
        .then(function () {
          return delDocBase(userIds);
        })
        .then(() => {
          this.getList();
          this.$modal.msgSuccess("删除成功");
        })
        .catch(() => { });
    },
  },
};
</script>
<style lang="scss" scoped>
.scaleFont {
  transform: scale(0.5);
  transform-origin: top left;
}

.table-page {
  width: 100%;
}

.wasd {
  td {
    padding: 1mm !important;
  }
}
</style>
